//
//  Web.m
//  comm
//
//  Created by nxj bill on 12-4-12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "XMLParse.h"


@implementation XMLParse


//-(void)abc{
////Protocol *myXMLSupportProtocol = @protocol(MyXMLSupport);
////	[[self delegate1] aaaaa];
//
//	NSString *url  = [self stringByEvaluatingJavaScriptFromString:@"document.getElementById('abc').getAttribute('a')"];
//	NSLog(url);
//	
//}s
-(void)loadLocalUrl:(NSString*)localUrl
{
	NSString *filePathOfIndex = [[NSBundle mainBundle] pathForResource:localUrl ofType:nil];
	NSString *strAbsPath= [NSString stringWithFormat:@"encodeURI('file:///%@')",filePathOfIndex];
	NSString *url  = [self stringByEvaluatingJavaScriptFromString:strAbsPath];
	[self stopLoading];
	[self loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
}


-(NSString*)getElementValue:(NSString*)condition
{
	return [self stringByEvaluatingJavaScriptFromString:condition];	
}



-(int)intValue:(NSString*)condition
{
	NSString *temp = [self stringByEvaluatingJavaScriptFromString:condition]; 
	NSLog(temp);
	return [temp intValue];
}


@end
